<?xml version="1.0" encoding="utf-8"?>
<Content type="xform" name="EditContent">
  <model>
    <instance>
      <tblContent>
        <nContentKey/>
        <nContentPrimaryId/>
        <nVersion/>
        <cContentForiegnRef/>
        <cContentName/>
        <cContentSchemaName>Video</cContentSchemaName>
        <cContentXmlBrief>
          <Content showRelated="Tag">
            <Title/>
            <Author/>
            <Copyright/>
            <Images>
              <img class="thumbnail"/>
              <img class="detail"/>
            </Images>
            <Movies>
              <filename src="" />
            </Movies>
            <FileSize/>
            <Intro/>
            <Local url="">
              <img/>
            </Local>
            <YouTube code="" showSuggested="false" useHttps="false"/>
            <Vimeo code="" portrait="false" title="true" byline="false" autoplay="false" loop="false"  />
            <HTML5 videoMp4="" videoGG="" videoWebm="" autoplay="" controls="controls" loop="" muted="" poster="" preload="">
              <img class="display" />
            </HTML5>
            <VideoType/>
            <VideoSize/>
            <VideoRatio/>
            <VideoWidth/>
            <VideoHeight/>
          </Content>
        </cContentXmlBrief>
        <cContentXmlDetail>
          <Content>
            <Title/>
            <Author/>
            <Copyright/>
            <Images>
              <img class="thumbnail"/>
              <img class="display"/>
              <img class="detail"/>
            </Images>
            <Intro/>
            <Body/>
            <Movies>
              <filename src="" />
            </Movies>
            <FileSize/>
            <Intro/>
            <Local url="">
              <img/>
            </Local>
            <YouTube code="" showSuggested="false" useHttps="false"/>
            <Vimeo code="" portrait="false" title="true" byline="false" autoplay="false" loop="false"/>
            <HTML5 videoMp4="" videoGG="" videoWebm="" autoplay="autoplay" controls="controls" loop="" muted="" poster="" preload="">
              <img class="display" />
            </HTML5>
            <VideoType/>
            <VideoSize/>
            <VideoRatio/>
            <VideoWidth/>
            <VideoHeight/>
          </Content>
        </cContentXmlDetail>
        <nAuditId/>
        <nAuditKey/>
        <dPublishDate/>
        <dExpireDate/>
        <dInsertDate/>
        <nInsertDirId/>
        <dUpdateDate/>
        <nUpdateDirId/>
        <nStatus>1</nStatus>
        <cDescription/>
      </tblContent>
    </instance>
    <submission id="EditContent" action="" method="post" event="return form_check(this)"/>
    <bind nodeset="tblContent">
      <bind id="cContentName" nodeset="cContentName" required="true()" type="string"/>
      <bind id="dPublishDate" nodeset="dPublishDate" required="false()" type="string"/>
      <bind id="dExpireDate" nodeset="dExpireDate" required="false()" type="string"/>
      <bind id="nStatus" nodeset="nStatus" required="true()" type="string"/>
      <bind id="cDescription" nodeset="cDescription" required="false()" type="string"/>
      <bind nodeset="cContentXmlBrief/Content">
        <bind id="cPosition" nodeset="@position" required="true()" type="string"/>
        <bind id="cContentName" nodeset="Title" required="true()" type="string"/>
        <bind id="cContentImageAuthor" nodeset="Author" required="false()" type="string"/>
        <bind id="cContentImageCopyright" nodeset="Copyright" required="false()" type="string"/>
        <bind id="cContentThumbnail" nodeset="Images/img[@class='thumbnail']" required="false()" type="xml-replace"/>
        <bind id="cContentPicture" nodeset="Images/img[@class='display']" required="false()" type="xml-replace"/>
        <bind id="cContentDetail" nodeset="Images/img[@class='detail']" required="false()" type="xml-replace"/>
        <bind id="cContentShortDesc" nodeset="Intro" required="false()" type="string"/>
        <bind id="cContentBody" nodeset="Body" required="false()" type="string"/>
        <bind id="cContentMovie" nodeset="Movies/filename/@src" required="false()" type="string"/>
        <bind id="cVideoType" nodeset="VideoType" required="false()" type="string"/>
        <bind id="cVideoSize" nodeset="VideoSize" required="false()" type="string"/>
        <bind id="cVideoRatio" nodeset="VideoRatio" required="false()" type="string"/>
        <bind id="cVideoWidth" nodeset="VideoWidth" required="false()" type="string"/>
        <bind id="cVideoHeight" nodeset="VideoHeight" required="false()" type="string"/>
        <bind nodeset="Local">
          <bind id="cLocalUrl" nodeset="@url" required="false()" type="string"/>
          <bind id="cLocalImage" nodeset="img" required="false()" type="xml-replace"/>
        </bind>
        <bind nodeset="YouTube">
          <bind id="cYouTubeCode" nodeset="@code" required="false()" type="string"/>
          <bind id="cYouTubeShowSuggested" nodeset="@showSuggested" required="false()" type="string"/>
          <bind id="cYouTubeUseHttps" nodeset="@useHttps" required="false()" type="string"/>
        </bind>
        <bind nodeset="Vimeo">
          <bind id="cVimeoCode" nodeset="@code" required="false()" type="string"/>
          <bind id="cVimeoTitle" nodeset="@title" required="false()" type="string"/>
          <bind id="cVimeoByline" nodeset="@byline" required="false()" type="string"/>
          <bind id="cVimeoPortrait" nodeset="@portrait" required="false()" type="string"/>
          <bind id="cVimeoAutoplay" nodeset="@autoplay" required="false()" type="string"/>
          <bind id="cVimeoLoop" nodeset="@loop" required="false()" type="string"/>
        </bind>
        <bind nodeset="HTML5">
          <bind id="cVideoMp4" nodeset="@videoMp4" required="false()" type="string"/>
          <bind id="cVideoGG" nodeset="@videoGG" required="false()" type="string"/>
          <bind id="cVideoWebm" nodeset="@videoWebm" required="false()" type="string"/>
          <bind id="cAutoplay" nodeset="@autoplay" required="false()" type="string"/>
          <bind id="cControls" nodeset="@controls" required="false()" type="string"/>
          <bind id="cloop" nodeset="@loop" required="false()" type="string"/>
          <bind id="cmuted" nodeset="@muted" required="false()" type="string"/>
          <bind id="cpreload" nodeset="@preload" required="false()" type="string"/>
          <bind id="cposter" nodeset="img[@class='display']" required="false()" type="xml-replace"/>
        </bind>
      </bind>
      <bind nodeset="cContentXmlDetail/Content">
        <bind id="cPosition" nodeset="@position" required="true()" type="string"/>
        <bind id="cContentName" nodeset="Title" required="true()" type="string"/>
        <bind id="cContentImageAuthor" nodeset="Author" required="false()" type="string"/>
        <bind id="cContentImageCopyright" nodeset="Copyright" required="false()" type="string"/>
        <bind id="cContentThumbnail" nodeset="Images/img[@class='thumbnail']" required="false()" type="xml-replace"/>
        <bind id="cContentPicture" nodeset="Images/img[@class='display']" required="false()" type="xml-replace"/>
        <bind id="cContentDetail" nodeset="Images/img[@class='detail']" required="false()" type="xml-replace"/>
        <bind id="cContentShortDesc" nodeset="Intro" required="false()" type="string"/>
        <bind id="cContentBody" nodeset="Body" required="false()" type="string"/>
		    <bind id="cContentMovie" nodeset="Movies/filename/@src" required="false()" type="string"/>
        <bind id="cVideoType" nodeset="VideoType" required="false()" type="string"/>
        <bind id="cVideoSize" nodeset="VideoSize" required="false()" type="string"/>
        <bind id="cVideoRatio" nodeset="VideoRatio" required="false()" type="string"/>
        <bind id="cVideoWidth" nodeset="VideoWidth" required="false()" type="string"/>
        <bind id="cVideoHeight" nodeset="VideoHeight" required="false()" type="string"/>
        <bind nodeset="Local">
          <bind id="cLocalUrl" nodeset="@url" required="false()" type="string"/>
          <bind id="cLocalImage" nodeset="img" required="false()" type="xml-replace"/>
        </bind>
        <bind nodeset="YouTube">
          <bind id="cYouTubeCode" nodeset="@code" required="false()" type="string"/>
          <bind id="cYouTubeShowSuggested" nodeset="@showSuggested" required="false()" type="string"/>
          <bind id="cYouTubeUseHttps" nodeset="@useHttps" required="false()" type="string"/>
        </bind>
        <bind nodeset="Vimeo">
          <bind id="cVimeoCode" nodeset="@code" required="false()" type="string"/>
          <bind id="cVimeoTitle" nodeset="@title" required="false()" type="string"/>
          <bind id="cVimeoByline" nodeset="@byline" required="false()" type="string"/>
          <bind id="cVimeoPortrait" nodeset="@portrait" required="false()" type="string"/>
          <bind id="cVimeoAutoplay" nodeset="@autoplay" required="false()" type="string"/>
          <bind id="cVimeoLoop" nodeset="@loop" required="false()" type="string"/>
        </bind>
        <bind nodeset="HTML5">
          <bind id="cVideoMp4" nodeset="@videoMp4" required="false()" type="string"/>
          <bind id="cVideoGG" nodeset="@videoGG" required="false()" type="string"/>
          <bind id="cVideoWebm" nodeset="@videoWebm" required="false()" type="string"/>
          <bind id="cAutoplay" nodeset="@autoplay" required="false()" type="string"/>
          <bind id="cControls" nodeset="@controls" required="false()" type="string"/>
          <bind id="cloop" nodeset="@loop" required="false()" type="string"/>
          <bind id="cmuted" nodeset="@muted" required="false()" type="string"/>
          <bind id="cpreload" nodeset="@preload" required="false()" type="string"/>
          <bind id="cposter" nodeset="img[@class='display']" required="false()" type="xml-replace"/>
        </bind>
      </bind>
    </bind>
  </model>
  <group ref="EditContent" class="2col"> 
    <label>Edit Video in list</label>
    <group class="ContentColumn1">
      <group ref="Settings" class="leftSettings">
        <input bind="nContentKey" class="hidden">
          <label>ContentId</label>
        </input>
        <label>Settings</label>
        <input bind="cPosition" class="readonly">
          <label>Position</label>
        </input>
        <input bind="dPublishDate" class="calendar short">
          <label>Publish Date</label>
        </input>
        <input bind="dExpireDate" class="calendar short">
          <label>Expire Date</label>
        </input>
        <select1 bind="nStatus" appearance="full" class="required vshort">
          <label>Status</label>
          <item>
            <label>Live</label>
            <value>1</value>
          </item>
          <item>
            <label>Hidden</label>
            <value>0</value>
          </item>
        </select1>
        <input bind="cDescription" class="short">
          <label>Change Notes</label>
        </input>
      </group>
      <group class="Content">
        <label>Image Files</label>
        <input bind="cContentFullSizePicture" class="short pickImage">
          <label>Main Image</label>
        </input>
        <hint>Smaller images will be automatically resized from the fullsize. If you want to use alternative images you can add them here.</hint>
        <input bind="cContentThumbnail" class="short pickImage">
          <label>Alternative Thumbnail</label>
        </input>
        <input bind="cContentDetail" class="short pickImage">
          <label>Alternative Picture</label>
        </input>
      </group>
    </group>
    <group class="ContentColumn2">
      <group ref="Content" class="Content">
        <label>Video Details</label>
        <input bind="cContentName" class="required long">
          <label>Title</label>
        </input>
        <input bind="cContentImageAuthor" class="short">
          <label>Author</label>
        </input>
        <input bind="cContentImageCopyright" class="short">
          <label>Copyright</label>
        </input>
        <group>
          <label>Source</label>
            <select1 bind="cVideoType" appearance="full">
              <item>
                <label>HTML5</label>
                <value>HTML5</value>
                <toggle case="cTypeHTML5" event="DOMActivate"/>
              </item>
              <item>
                <label>YouTube</label>
                <value>YouTube</value>
                <toggle case="cTypeYouTube" event="DOMActivate"/>
              </item>
              <item>
                <label>Vimeo</label>
                <value>Vimeo</value>
                <toggle case="cTypeVimeo" event="DOMActivate"/>
              </item>
              <item>
                <label>Legacy FLV player</label>
                <value>Local</value>
                <toggle case="cTypeLocal" event="DOMActivate"/>
              </item>
            </select1>

          <switch class="disable">
            <!-- Local -->
            <case id="cTypeLocal">
              <input bind="cLocalUrl" class="pickMedia">
                <label>URL</label>
              </input>
              <input bind="cLocalImage" class="pickImage">
                <label>Alternative image</label>
                <help class="inline">
                  <p>
                    This image will be displayed before the video is played.
                  </p>
                </help>
              </input>
            </case>

            <!-- YouTube -->
            <case id="cTypeYouTube">
              <input bind="cYouTubeCode">
                <label>Video code</label>
                <help>
                  <p>
                    The video code is a 11 character alphanumeric code - you can find it by
                    clicking the "Share" button under a YouTube video and looking
                    at the last 11 characters of "Link to this video" address (shown below).
                  </p>
                  <p>
                    <img src="/ewcommon/images/admin/help/video/youtube.png" alt="" width="504" height="62"/>
                  </p>
                </help>
              </input>
              <select bind="cYouTubeShowSuggested" appearance="full">
                <label>Show suggested videos when the video finishes</label>
                <item>
                  <label></label>
                  <value>true</value>
                </item>
              </select>
              <select bind="cYouTubeUseHttps" appearance="full">
                <label>Use HTTPS</label>
                <item>
                  <label></label>
                  <value>true</value>
                </item>
              </select>
            </case>

            <!-- Vimeo-->
            <case id="cTypeVimeo">
              <input bind="cVimeoCode">
                <label>Video code</label>
                <help>
                  <p>
                    The video code is an 8 number numeric code - you can find it by
                    looking for the last 8 numbers in the address of your Vimeo video
                    (e.g. vimeo.com/<b>12345678</b>).
                  </p>
                </help>
              </input>
              <select bind="cVimeoTitle" appearance="full">
                <label>Show title</label>
                <item>
                  <label></label>
                  <value>true</value>
                </item>
              </select>
              <select bind="cVimeoByline" appearance="full">
                <label>Show byline</label>
                <item>
                  <label></label>
                  <value>true</value>
                </item>
              </select>
              <select bind="cVimeoPortrait" appearance="full">
                <label>Show portrait</label>
                <item>
                  <label></label>
                  <value>true</value>
                </item>
              </select>
              <select bind="cVimeoAutoplay" appearance="full">
                <label>Autoplay</label>
                <item>
                  <label></label>
                  <value>true</value>
                </item>
              </select>
              <select bind="cVimeoLoop" appearance="full">
                <label>Loop</label>
                <item>
                  <label></label>
                  <value>true</value>
                </item>
              </select>
            </case>

            <!--HTML5-->
            <case id="cTypeHTML5">
              <group class="">
                <input bind="cVideoMp4" class="pickMedia">
                  <label>
                    The MP4 Source for the HTML5 Video
                  </label>
                </input>
                <input bind="cVideoGG" class="pickMedia">
                  <label>
                    The OGV Source for the HTML5 Video
                  </label>
                </input>
                <input bind="cVideoWebm" class="pickMedia">
                  <label>
                    The WEBM Source for the HTML5 Video
                  </label>
                </input>
                <select bind="cControls" appearance="full">
                <item>
                  <label>Display controls for Video</label>
                  <value>controls</value>
                </item>
              </select>
                <select bind="cAutoplay" appearance="full">
                  <item>
                    <label>Enable Autoplay</label>
                    <value>autoplay</value>
                  </item>
                </select>
                <select bind="cLoop" appearance="full">
                  <item>
                    <label>Enable loop</label>
                    <value>loop</value>
                  </item>
                </select>
                <select bind="cmuted" appearance="full">
                  <item>
                    <label>Enable mute</label>
                    <value>muted</value>
                  </item>
                </select>
                <select1 bind="cpreload" appearance="">
                  <label>preload</label>
                  <item>
                    <label>Auto - load the entire video when the page loads</label>
                    <value>auto</value>
                  </item>
                  <item>
                    <label>None - NOT load the video when the page loads</label>
                    <value>none</value>
                  </item>
                  <item>
                    <label>MetaData - load only metadata when the page loads</label>
                    <value>metadata</value>
                  </item>
                </select1>
                <input bind="cposter" class="pickImage">
                  <label>Poster image</label>
                  <help class="inline">
                    <p>This image will be displayed before the video is played.</p>
                  </help>
                </input>
              </group>
            </case>

          </switch>
        </group>
        <group>
          <label>Size</label>

          <select1 bind="cVideoSize" appearance="full">
            <item>
              <label>Auto</label>
              <value>Auto</value>
              <toggle case="cSizeAuto" event="DOMActivate"/>
            </item>
            <item>
              <label>Manual</label>
              <value>Manual</value>
              <toggle case="cSizeManual" event="DOMActivate"/>
            </item>
          </select1>

          <switch class="disable">
            <case id="cSizeAuto">
              <select1 bind="cVideoRatio" class="short">
                <label>Ratio</label>
                <item>
                  <label>4:3</label>
                  <value>FourThree</value>
                </item>
                <item>
                  <label>16:9</label>
                  <value>SixteenNine</value>
                </item>
              </select1>
            </case>
            <case id="cSizeManual">
              <input bind="cVideoWidth" class="vshort" type="number">
                <label>Width</label>
              </input>
              <input bind="cVideoHeight" class="vshort" type="number">
                <label>Height</label>
              </input>
            </case>
          </switch>
        </group>
      </group>
      <group ref="mainContent" class="mainContent">
        <label>Short Description</label>
        <textarea bind="cContentShortDesc" class="TextArea xhtml" rows="7" cols="70">
        </textarea>
      </group>
      <group ref="mainContent" class="mainContent">
        <label>Full Description</label>
        <textarea bind="cContentBody" class="TextArea xhtml" rows="10" cols="70">
        </textarea>
        <relatedContent search="find add" type="Tag" relationType="Tag" direction="2way">
          <label>Related Tags</label>
        </relatedContent>
      </group>
    </group>
  </group>
  <group ref="submit" class="contentSubmit">
    <submit submission="" ref="ewSubmit" class="principle">
      <label>Save Video</label>
    </submit>
  </group>
</Content>
